#!/usr/bin/node

const log = console.log,
      Dog = require('./02-dog');

let teddy = new Dog('teddy',4);
let shepherd = new Dog('shepherd',8);

teddy.on('bark',onBark);
shepherd.on('bark',onBark);

function onBark(){
  log(`${this.name()} barked! enery:${this.enery()}`);

}

